package com.bgs.service.impl;

import com.bgs.dao.DormitoryMapper;
import com.bgs.dao.StudentDormitoryRelationMapper;
import com.bgs.pojo.Dormitory;
import com.bgs.pojo.StudentDormitoryRelation;
import com.bgs.pojo.vo.DormitoryVo;
import com.bgs.pojo.vo.StudentDormitoryRelationVo;
import com.bgs.service.DormitoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: 梁玉杰
 * @Date: 2021/8/12 16:22
 * @Description: TODO
 */
@Service
public class DormitoryServiceImpl implements DormitoryService {

    @Autowired
    private DormitoryMapper dormitoryMapper;

    @Autowired
    private StudentDormitoryRelationMapper SDMapper;


    @Override
    public List<Dormitory> findAll(DormitoryVo dormitoryVo) {
        return dormitoryMapper.findAll(dormitoryVo);
    }

    @Override
    public List<Dormitory> dorxlkone() {
        return dormitoryMapper.dorxlkone();
    }

    @Override
    public List<Dormitory> dorxlktwo(Dormitory d) {
        return dormitoryMapper.dorxlktwo(d);
    }
    @Override
    public List<Dormitory> dorxlkthree(Dormitory d) {
        return dormitoryMapper.dorxlkthree(d);
    }
    @Override
    public List<Dormitory> dorxlkgly() {
        return dormitoryMapper.dorxlkgly();
    }
    @Override
    public List<Dormitory> dorxlkcwsl() {
        return dormitoryMapper.dorxlkcwsl();
    }
    @Override
    public List<Dormitory> dorxlksyzt() {
        return dormitoryMapper.dorxlksyzt();
    }


    @Override
    public int insertSelective(Dormitory dor) {
        return dormitoryMapper.insertSelective(dor);
    }

    @Override
    public int updateByPrimaryKeySelective(Dormitory dor) {
        return dormitoryMapper.updateByPrimaryKeySelective(dor);
    }

    @Override
    public int deleteById(Integer pkId) {
        return dormitoryMapper.deleteByPrimaryKey(pkId);
    }

    @Override
    public int insertDS(StudentDormitoryRelation sD) {
        return SDMapper.insertSelective(sD);
    }

    @Override
    public List<StudentDormitoryRelation> dorfindAllds(StudentDormitoryRelation stuDor) {
        return SDMapper.findallDorStu(stuDor);
    }

    @Override
    public int deleteByIdSstu(Integer pkId) {
        return SDMapper.deleteByPrimaryKey(pkId);
    }

    //当前宿舍的现住学生
    @Override
    public Integer number(String dormitoryName) {
        return dormitoryMapper.number(dormitoryName);
    }


}
